Using old code on new version of Visual Studio [migrated]

Posted by Tu Tran on Programmers See other posts from Programmers or by Tu Tran
Published on 2013-11-13T10:32:35Z Indexed on 2013/11/13 16:15 UTC
Read the original article Hit count: 553

Filed under:
|
|

I have a project which was started from 90s in C/C++. Therefore, it contains many old coding styles such as K&R-style function declaration, obsolete function, ...

The project works fine in Visual Studio 2008, but now I want to use it in the new version of Visual Studio (specifically VS 2010) because we have other projects in Visual Studio 2010/2012. I don't want to have too many versions of Visual Studio on my machine.

When I try to compile the old project, Visual Studio throws too many errors. I can fix all of them but I am scared to edit the source code and I want other people to be able to pen it in the old version of VS too. I want the project to remain backwards compatible with VS.

My question is how to use the old code in Visual Studio 2010/2012 without changing the code. Or if necessary how do I just fix a few lines of code, but make sure it won't cause an error if someone else opens that code in the older version of VS. Is there a way to tell newer Visual Studio versions to use older compiler flags or something like that?

© Programmers or respective owner

Related posts about c

    Related posts about visual-studio